home *** CD-ROM | disk | FTP | other *** search
- on exitFrame
- global bucketcol, level1, NumofCol, pal, kingcolor, mastercounter, origsprites, steplimit
- if level1 = 1 then
- set prefix to "pc1."
- set offset to 0
- else
- set prefix to "pc2."
- set offset to 10
- end if
- repeat with xxx = 38 to 37 + NumofCol
- puppetSprite(xxx, 1)
- if level1 = 1 then
- set the castNum of sprite xxx to the number of cast (prefix & getAt(pal, xxx - 37))
- end if
- set the visible of sprite xxx to 1
- end repeat
- set kingcolor to getAt(pal, 1)
- set steplimit to []
- set origsprites to []
- repeat with xxx = 1 to NumofCol
- if level1 = 1 then
- set mycancolor to getAt(pal, xxx)
- else
- set mycancolor to xxx
- end if
- add(steplimit, getAt(mastercounter, mycancolor + offset))
- set myloch to the locH of sprite (xxx + 37)
- set mylocv to the locV of sprite (xxx + 37)
- add(origsprites, list(mycancolor, myloch, mylocv))
- end repeat
- set bucketcol to []
- repeat with xxx = 1 to count(pal)
- if level1 = 1 then
- add(bucketcol, getAt(pal, xxx))
- next repeat
- end if
- add(bucketcol, xxx)
- end repeat
- set crunch to pal
- set pal to []
- repeat with xxx = 1 to NumofCol
- set sample to random(count(crunch))
- add(pal, getAt(crunch, sample))
- deleteAt(crunch, sample)
- end repeat
- puppetSound(0)
- end
-